<?php
function getPageTitle($name){
	$result = DBSelectToArray("title", "lp_page", "name='$name' LIMIT 1");
	return $result['title'];
}

function getPagePath($name){
	$result = DBSelectToArray("path", "lp_page", "name='$name' LIMIT 1");
	return $result['path'];
}

function getPageImage($name){
	$result = DBSelectToArray("image", "lp_page", "name='$name' LIMIT 1");
	return $result['image'];
}

function isPageAllowed($name){
	$result = DBSelectToArray("rights", "lp_page", "name='$name' LIMIT 1");
	if($result['rights'] == 1){
		return true;
	} elseif($result['rights'] == 2){
		if(logged_in())
			return true;
	} elseif($result['rights'] == 4){
		if(logged_in()){
			if(getUserRight($_SESSION["username"]) == 4)
				return true;
		}
	}
	return false;
}

function isPage($name){
	$result = DBSelect("*", "lp_page", "name='$name'", "");
	return mysql_num_rows($result) > 0;
}
?>